package cn.darkhorse.mesadmin.controller.ticket;


import cn.darkhorse.ticket.store.pojo.TicketInventory;
import cn.darkhorse.ticket.store.service.TicketInventoryService;
import cn.darkhorse.ticket.store.vo.TicketInventoryVO;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 库存信息 前端控制器
 * </p>
 *
 * @author wangxinghui
 * @since 2024-01-16
 */
@RestController
@RequestMapping("/ticket/ticketInventory")
public class TicketInventoryController extends BaseController{

	@Resource
	private TicketInventoryService inventoryService;
	
	/**
	 * 列表
	 * @param productCode
	 * @param productName
	 * @param productTypeId
	 * @return
	 */
	@RequestMapping(value = "/list",method = RequestMethod.GET)
	public TableDataInfo list(String productCode, String productName, Long productTypeId){
		startPage();
		List<TicketInventory> inventoryList = inventoryService.list(productCode, productName, productTypeId);
		return getDataTable(inventoryList);
	}
	
	/**
	 * 详情
	 * @param productId
	 * @return
	 */
	@RequestMapping(value = "/view",method = RequestMethod.GET)
	public AjaxResult view(Long productId){
		TicketInventoryVO vo = inventoryService.view(productId);
		return AjaxResult.success(vo);
	}
	
	
}

